NET PGP Library
Quick Start CSharp

PgpEncryptorDecryptor pgpEncryptorDecryptor = new PgpEncryptorDecryptor(); //Trial Mode
//PgpEncryptorDecryptor pgpEncryptorDecryptor = new PgpEncryptorDecryptor("place user name here", "place license key here"); //License Mode

// we need to generate the keys first if we haven't got them already
string username = "username";
string password = "password";
string directoryForKeys = Directory.GetCurrentDirectory();
string publicKeyFilePath = Path.Combine(directoryForKeys, "public.asc");
string privateKeyFilePath = Path.Combine(directoryForKeys, "private.asc");

pgpEncryptorDecryptor.GenerateKeyPairFiles(username, password, publicKeyFilePath, privateKeyFilePath);

//Create a test file
string directoryForFiles = Directory.GetCurrentDirectory();
string inputFilePath = Path.Combine(directoryForFiles, "input.txt");
File.WriteAllText(inputFilePath, "This is a test");

string encryptedFilePath = Path.Combine(directoryForFiles, "encrypted.pgp");
bool armor = true;

pgpEncryptorDecryptor.EncryptFile(inputFilePath, encryptedFilePath, publicKeyFilePath, armor);

// decrypt file        
string decryptedFilePath = Path.Combine(directoryForFiles, "decrypted.txt");
pgpEncryptorDecryptor.DecryptFile(encryptedFilePath, decryptedFilePath, privateKeyFilePath, "password");